using UnityEngine;
namespace NL.Advanced
{

    public partial class CameraBase
    {


        public CameraCorner[] ViewBoundCorners;


        void _InitCorner()
        {
            if (ViewBoundCorners != null) return;

            var root = gameObject.ADDChild("Corners");

            root.ADDChild("00").AddComponent<CameraCorner>().SetViewPoint(new Vector2(-1, -1));
            root.ADDChild("01").AddComponent<CameraCorner>().SetViewPoint(new Vector2(-1, 1));
            root.ADDChild("11").AddComponent<CameraCorner>().SetViewPoint(new Vector2(1, 1));
            root.ADDChild("10").AddComponent<CameraCorner>().SetViewPoint(new Vector2(1, -1));

            ViewBoundCorners = GetComponentsInChildren<CameraCorner>();
        }

        protected virtual void OnDrawGizmos()
        {

            Gizmos.color = Color.yellow;
            Gizmos.DrawLine(transform.position, transform.position + transform.forward * 100);
        }
    }
}

